unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ActiveX, P4COM_TLB, Tp4_lib;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    btnRun: TButton;
    procedure btnRunClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btnRunClick(Sender: TObject);
var
  p4: Tp4;
  info: TstringList;
  msg: String;
  i: integer;
begin
  p4 := tp4.Create;
  p4.Port := '1666';
  msg := p4.Port;
{  MessageBox(0, pansichar(msg), 'p4comtest', MB_OK);
}
  p4.User := 'robert';
  p4.Client := 'bruno_ws';
  p4.Connect;
  info := p4.run('info');
  for i := 0 to info.Count - 1 do
    listbox1.Items.add(info[i]);
  p4.Destroy;
end;

end.
